package com.naiterui.ehp.bs.pharmacist.service;

import com.naiterui.common.repository.page.PageParamVO;
import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.bo.esign.PreSignResultBO;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.pharmacist.vo.recommend.AuditParamVO;
import com.naiterui.ehp.bs.pharmacist.vo.recommend.MedicationRecomVO;
import com.naiterui.ehp.bs.pharmacist.vo.recommend.PrescriptionDetailVO;

import java.util.Set;

/**
 * @Description 推荐业务接口
 * @Author gongbaoqiang
 * @Date 2019/12/5 1:29 PM
 */
public interface IRecommendService {

    /**
     * <pre>
     *     分页查询处方列表
     * </pre>
     * @param pharmacistId 当前登录药师id
     * @param status 审核状态(0:待审核,1:全部,2:审核过的)
     * @param pageParamVO
     * @return
     * @throws BusinessException
     */
    PageVO<MedicationRecomVO> findAll(Long pharmacistId, Integer status, PageParamVO pageParamVO) throws BusinessException;

    /**
     * <pre>
     *     查询处方详情
     * </pre>
     * @param recomId
     * @return
     * @throws BusinessException
     */
    PrescriptionDetailVO findDetailById(Long recomId) throws BusinessException;

    /**
     * <pre>
     *     获取预签名unionId
     * </pre>
     * @param recomId
     * @return
     * @throws BusinessException
     */
    PreSignResultBO getUnionId(Long recomId, Long pharmacistId) throws BusinessException;


    /**
     * 药师签名
     *
     * @throws BusinessException
     */
    void sign(Long pharmacistId, Long recomId, String uniqueId, String pin) throws BusinessException;

    /**
     * <pre>
     *     审核处方
     * </pre>
     *
     * @param paramVO
     * @throws BusinessException
     */
    void audit(AuditParamVO paramVO, Long pharmacistId) throws BusinessException;

    /**
     * 自动审核处方
     * @param recomId 处方id
     * @throws BusinessException
     */
    void autoAudit(Long recomId) throws BusinessException;

    /**
     * 调配药师预签名
     * @param recomId
     * @param pharmacistId
     * @return
     * @throws BusinessException
     */
    PreSignResultBO preAlSign(Long recomId, Long pharmacistId) throws BusinessException;

    /**
     * 调配药师签名
     * @param pharmacistId
     * @param recomId
     * @param uniqueId
     * @param pin
     * @throws BusinessException
     */
    void alSign(Long pharmacistId, Long recomId, String uniqueId, String pin) throws BusinessException;

    /**
     * 调配药师审核
     * @param recomId 处方id
     * @throws BusinessException
     */
    void allocateAudit(Long recomId);

    /**
     * 处理审核药师Id
     * @param pharmacistId 药师Id
     * @param type 类型 1.自动审核药师 2.调配药师
     * @param operate 操作 1.新增 2.移除
     */
    void handleAuditPharmacist(Long pharmacistId, Integer type, Integer operate);

    /**
     * 获取审核药师集合
     * @param type
     * @return
     */
    Set<String> getAuditPharmacist(Integer type);
}
